<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('basic');
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$hdps =array(
		array('title'=>'首页','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp01.jpg','action'=>'index/'),
		array('title'=>'全部','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp02.jpg','action'=>'allplugins/'),
	);
	$return['item']['hdps']=$return['item']['hdps']?$return['item']['hdps']:$hdps;
	$footernav = array(
			array('title'=>'首页','icon'=>'icon-shouye','color'=>'#cc99ff','action'=>'jy_weishopke/index/','image'=>'../addons/jy_weishop/resource/images/jy_weishoparticle.png'),
			array('title'=>'推荐','icon'=>'icon-viewlist','color'=>'#66cc99','action'=>'jy_weishopke/goods.index/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'搜索','icon'=>'icon-compass','color'=>'#ff9933','action'=>'jy_weishopke/goods.groups/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'订单','icon'=>'icon-manageorder','color'=>'#66cc66','action'=>'jy_weishopke/order.list/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'我的','icon'=>'icon-wo1','color'=>'#FF83FA','action'=>'jy_weishopke/member.index/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
	);
	$return['item']['demofooternav']=$footernav;
	$return['item']['footernav'] = !empty($return['item']['footernav']) ? $return['item']['footernav'] : $footernav;
	$bankuai =array(
		array('title'=>'淘宝','desc'=>'最高返90%','img'=>'../addons/jy_weishopke/resource/images/icon-taobao.png','action'=>'jy_weishopke/goods.index//pluginname=jy_taobaoke'),
		array('title'=>'京东','desc'=>'最高返90%','img'=>'../addons/jy_weishopke/resource/images/icon-jd.png','action'=>'jy_weishopke/goods.index//pluginname=jy_jdk'),
		array('title'=>'拼多多','desc'=>'1.9元包邮','img'=>'../addons/jy_weishopke/resource/images/icon-pdd.png','action'=>'jy_weishopke/goods.index//pluginname=jy_pddke'),
		array('title'=>'天猫超市','desc'=>'1元专享','img'=>'../addons/jy_weishopke/resource/images/icon-tianmao.png','action'=>'jy_weishopke/goods.index//pluginname=jy_taobaoke'),
		//array('title'=>'唯品会','desc'=>'天天有三折','img'=>'../addons/jy_weishopke/resource/images/icon-wph.png','action'=>'jy_weishopke/goods.index//pluginname=jy_wphke'),
	);
	$return['item']['demobankuai']=$bankuai;
	$return['item']['bankuai'] = !empty($return['item']['bankuai']) ? $return['item']['bankuai'] : $bankuai;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'基本设置',
		'tabs'=>$tabs,
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本设置',
				'list'=>array(
					array('type'=>'string','title'=>'平台名称','name'=>'title'),
					array('type'=>'image','title'=>'平台logo','name'=>'logo','help'=>'建议尺寸：170*60'),
					array('type'=>'unitstring','unit'=>'%','title'=>'普通会员佣金比率','name'=>'ratio','help'=>'必须是整数'),
					array('type'=>'unitstring','unit'=>'%','title'=>'运营总监佣金比率','name'=>'vipratio','help'=>'必须是整数'),
					array('type'=>'unitstring','unit'=>'元','title'=>'运营总监会员价格','name'=>'vipprice','help'=>'必须是整数'),
					array('type'=>'switch','title'=>'淘宝客开启弹窗口令模式','name'=>'open_modal','help'=>'默认直接跳转到淘宝详情页，如果开启，则只是弹窗：淘宝口令'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
				'title'=>'首页幻灯片',
					'list'=>array(
						array(
							'type'=>'array',
							'name'=>'hdps',
							'add_tip'=>'添加幻灯片',
								'list'=>array(
									array('type'=>'string','name'=>'title','title'=>'标题'),
									array('type'=>'image','name'=>'picurl','title'=>'图片'),
									array('type'=>'string','name'=>'url','title'=>'链接'),
									
								),
								'details'=>array(
									array('type'=>'string','name'=>'title','title'=>'标题'),
									array('type'=>'image','name'=>'picurl','title'=>'图片','help'=>''),
									array('type'=>'link','name'=>'action','from'=>'action','title'=>'链接'),
									
								)
						),
				)
			),
			array(
				'title'=>'首页图标菜单',
					'list'=>array(
						array('type'=>'updemo','name'=>'bankuai','demo'=>'demobankuai','title'=>'重置图标菜单','help'=>'不知道添加什么图标菜单？重置默认的一下试试！'),
						array(
							'type'=>'array',
							'name'=>'bankuai',
							'add_tip'=>'添加图标',
								'list'=>array(
									array('type'=>'image','name'=>'img','title'=>'图片'),
									array('type'=>'string','name'=>'title','title'=>'标题'),
									array('type'=>'string','name'=>'desc','title'=>'描述'),
									array('type'=>'string','name'=>'action','title'=>'链接'),
								),
								'details'=>array(
									array('type'=>'image','name'=>'img','title'=>'图片','help'=>''),
									array('type'=>'string','name'=>'title','title'=>'标题'),
									array('type'=>'string','name'=>'desc','title'=>'描述'),
									array('type'=>'link','name'=>'action','from'=>'action','title'=>'链接'),
								)
						),
						
					)
			),
			array(
				'title'=>'vip收费设置',
				'list'=>array(
					array('type'=>'switch','title'=>'是否关闭VIP功能？','name'=>'no_vip','help'=>'关闭VIP功能，不再显示购买VIP'),
					array('type'=>'string','title'=>'月费','name'=>'mfee'),
					array('type'=>'string','title'=>'月费原价','name'=>'mfee0'),
					array('type'=>'string','title'=>'季费','name'=>'jfee'),
					array('type'=>'string','title'=>'季费原价','name'=>'jfee0'),
					array('type'=>'string','title'=>'年费','name'=>'yfee'),
					array('type'=>'string','title'=>'年费原价','name'=>'yfee0'),
					array('type'=>'image','title'=>'充值会员页面背景图','name'=>'vipbg','help'=>'建议尺寸：高360px*宽640px'),
				)
			),
			array(
				'title'=>'底部菜单',
					'list'=>array(
						array('type'=>'updemo','name'=>'footernav','demo'=>'demofooternav','title'=>'重置底部菜单','help'=>'不知道添加什么底部菜单？重置默认的一下试试！'),
						array(
							'type'=>'array',
							'name'=>'footernav',
							'add_tip'=>'添加菜单',
								'list'=>array(
									array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'图标'),
									array('type'=>'string','name'=>'title','title'=>'标题'),
									array('type'=>'string','name'=>'action','title'=>'链接'),
								),
								'details'=>array(
									array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'图标'),
									array('type'=>'string','name'=>'title','title'=>'标题'),
									array('type'=>'link','name'=>'action','from'=>'action','title'=>'链接'),
								)
						),
						
					)
			),
			array(
				'title'=>'分销设置',
				'list'=>array(
					array('type'=>'tip','title'=>'[<red>温馨提示</red>]：只有开启了高级接口权限（淘宝客，京东客，拼多多等高级api接口）的，才能获取到订单信息，分佣信息等，下面的分销也才有用'),
					array('type'=>'switch','title'=>'按笔分销？','name'=>'get_buyordernum','help'=>'开启按笔分销后，计算佣金，就按每笔成交的订单来固定结算佣金！例如：1元/笔'),
					array('type'=>'switch','title'=>'分销内购','name'=>'self_commission','help'=>'开启后，分销佣金计算将从顾客本人算起，本人获得一级佣金，上线获得二级佣金，以此类推'),
					array('type'=>'radio','title'=>'显示分销佣金方式','name'=>'showgetfee','options'=>'showgetfee','help'=>'显示分销佣金：首页+商品详情页都显示可得佣金'),
					array('type'=>'string','title'=>'分佣显示名称','name'=>'showgettitle','help'=>'默认：‘预估赚’；4个字以内！'),
					array('type'=>'unitstring','title'=>'每单平台补贴','name'=>'sysbutie','unit'=>'元','help'=>'平台补贴'),
				)
			),
			array(
				'title'=>'上下线关系及分销资格',
				'list'=>array(
					array('type'=>'radio','title'=>'成为下线条件','name'=>'become_child','options'=>'become_child'),
					array('type'=>'radio','title'=>'成为分销商条件','name'=>'become','options'=>'become'),
					array('type'=>'string','title'=>'消费次数达到（次）','name'=>'num','show'=>array('become'=>2)),
					array('type'=>'string','title'=>'消费金额达到（元）','name'=>'money','show'=>array('become'=>3)),
					array('type'=>'radio','title'=>'分销商是否需要审核','name'=>'become_check','options'=>'is'),
					array('type'=>'radio','title'=>'分销商必须完善资料','name'=>'become_reg','options'=>'is'),
					)
			),
			array(
				'title'=>'结算',
				'list'=>array(
					//array('type'=>'radio','title'=>'提现方式','name'=>'withdrawtype','options'=>'withdraw'),
					array('type'=>'string','title'=>'结算额度（元）','name'=>'balance_money','help'=>'佣金达到该数值才能结算'),
					array('type'=>'string','title'=>'佣金打款手续费（%）','name'=>'balance_per'),
					array('type'=>'radio','title'=>'佣金计算方式','name'=>'commissiontype','options'=>'commissiontype','help'=>''),
					array('type'=>'string','title'=>'免手续费提现区间开始金额','name'=>'balance_money_start'),
					array('type'=>'string','title'=>'免手续费提现区间结束金额','name'=>'balance_money_end','help'=>'当提现手续费金额在此区间内时,不扣除提现手续费. 结束金额 必须大于 开始金额才能生效'),
					array('type'=>'string','title'=>'结算天数','name'=>'balance_day','help'=>'当订单完成后的n天后，佣金才能申请提现,设置0或空，订单完成就可以结算'),
				),
			),
			array(
				'title'=>'分销商等级升级',
				'list'=>array(
						array('type'=>'checkbox','title'=>'分销商升级依据','name'=>'level_up_types','options'=>'leveltype'),		
					)
			),
		),
	);
	$return['leveltype']=$this->level_up_types;
	$return['withdraw']=array('1'=>'商城余额','2'=>'微信钱包');
	$return['commissiontype']=$this->commission_types;
	$return['is']=array('0'=>'否','1'=>'是');
	$return['become_child']=array('1'=>'首次点击链接','2'=>'首次下单','3'=>'首次付款');
	$return['become']=array('0'=>'无条件','1'=>'申请','2'=>'消费次数','3'=>'消费金额');
	$return['showgetfee']=array('0'=>'不显示','1'=>'全部可见','2'=>'仅代理商可见');
	$return['htmls']=$htmls;
	exi($return);
}